package com.example.health;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class Serach_main extends Activity {

	private EditText et;
	private Button bt;
	private Button bt2;
	private String info;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.activity_serach_main);
	    
	    getActionBar().setDisplayHomeAsUpEnabled(true);
	    
	    
	    // TODO Auto-generated method stub
	    et=(EditText)findViewById(R.id.edit_text); // 검색어 입력란
	    bt2=(Button)findViewById(R.id.button1); // 지역검색버튼
	    
	    
	    bt2.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				info=et.getText().toString();
						
						Intent intent = new Intent(getApplicationContext(), NaverLocal.class);
				Bundle data = new Bundle();
				data.putString("key", info);
				intent.putExtras(data);
				startActivity(intent);
				
			}
		});
	}
	
	@Override
	public boolean onOptionsItemSelected(android.view.MenuItem item) {

		switch(item.getItemId()){
		case android.R.id.home:
			finish();
			return true;
		}
		
		
		return super.onOptionsItemSelected(item);
	}

}
